#类和对象

class Animal:
    def __init__(self,name,weight,legNum):
        self.name = name
        self.weight = weight
        self.legNum = legNum

    def __str__(self):
        dec = "我的名字是%s，体重是%dkg，我有%d条腿"%(self.name,self.weight,self.legNum)
        return dec

dog = Animal("柯基",10,4)
print(dog)